
import java.util.*;

public class Main11 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);

        Map<String, Object> S1 = new HashMap();
        Map<String, Object> S2 = new HashMap();

        String line = input.nextLine();
        String[] lines = line.split(" ");

        int index = 0;

        int s1_index = 0;
        while (s1_index < 5) {
            String s = lines[index];
            if (S1.get(s) != null) {
                index++;
            } else {
                S1.put(s, true);
                s1_index++;
            }
        }
        index++;


        int s2_index = 0;
        while (s2_index < 5) {
            String s = lines[index];
            if (S2.get(s) != null) {
                index++;
            } else {
                S2.put(s, true);
                s2_index++;
            }
        }


        ArrayList<String> list = new ArrayList();
        for (String s : S1.keySet()) {
            if (list.contains(s)) {
                continue;
            }
            list.add(s);
        }

        for (String s : S2.keySet()) {
            if (list.contains(s)) {
                continue;
            }
            list.add(s);
        }

        list.sort(Comparator.naturalOrder());

        for (String s : list) {
            System.out.println(s);
        }
    }
}
